import "package:flutter/material.dart";

import "../../pages/general/SetRevisionPlanView.dart";

class RevisionPlanSettingButton extends StatefulWidget {
  const RevisionPlanSettingButton({
    super.key,
    this.width = 28.0,
    this.height = 28.0
  });
  final double width;
  final double height;

  @override
  State<RevisionPlanSettingButton> createState() => _RevisionPlanSettingButtonState();
}

class _RevisionPlanSettingButtonState extends State<RevisionPlanSettingButton> {

  void toSetRevisionPlanView(){
    Navigator.of(context).push(
      MaterialPageRoute(
        builder: (context) => const SetRevisionPlanView()
      )
    );
  }

  @override
  Widget build(BuildContext context) {
    return SizedBox(
        height: widget.height,
        width: widget.width,
        child: ElevatedButton(
            style: ButtonStyle(
              padding: WidgetStateProperty.all(const EdgeInsets.all(0)),
              backgroundColor: WidgetStateProperty.all(Theme.of(context).colorScheme.primary),
              shape: WidgetStateProperty.all(
                RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
              ),
            ),
            onPressed: toSetRevisionPlanView,
            child: const Icon(Icons.settings,color: Colors.white,)
        )
    );
  }
}

